//
//  XBookkeepingItemView.m
//  iAccountBook
//
//  Created by 侯伟 on 2021/8/29.
//

#import "XBookkeepingItemView.h"
#import "XDynamicModel.h"

@interface XBookkeepingItemView (){
    UIImageView* _typeImage;
    UILabel* _typeLb;
    UILabel* _amtLb;
}
/// 显示内容视图
@property(nonatomic,weak) MyLinearLayout* contentLayout;

@end

@implementation XBookkeepingItemView

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.myHeight = PX(50);
        
        [self initSubViews];
    }
    return self;
}

- (void)initSubViews{
    
    UIImageView* typeImage = [[UIImageView alloc] init];
    typeImage.myLeft = 0;
    typeImage.myVertMargin = 0;
    typeImage.mySize = CGSizeMake(PX(30), PX(30));
    [self addSubview:typeImage];
    _typeImage = typeImage;
    
    UILabel* typeLb = [UILabel lableWithFont:FONT_FIT(15) color:COLOR_BLACK_DARK text:@"--"];
    typeLb.leftPos.equalTo(typeImage.rightPos).offset(10);
    typeLb.myCenterY = 0;
    [self addSubview:typeLb];
    _typeLb = typeLb;

    UILabel* amtLb = [UILabel lableWithFont:FONT_FIT(15) color:COLOR_BLACK_DARK text:@"--"];
    amtLb.myRight = amtLb.myCenterY = 0;
    [self addSubview:amtLb];
    _amtLb = amtLb;
}


- (void)setModel:(XDynamicModel *)model{
    
//    _titleLb.text = [model.name substringToIndex:1];
//    [_titleLb sizeToFit];
//
//    _nameLb.text = model.name;
//    [_nameLb sizeToFit];
}
@end
